keymap: change to support bold and italic keyboard shortcuts.#204
keymap: change to support bold and italic keyboard shortcuts.#204gyger wants to merge 1 commit intocosmocode:masterfrom
Conversation
|
Together with PR #203 they solve #122. If you want I can also merge the two pull requests into one. We could also add other commands easily. As an inspiration from the sample file (https://github.com/ProseMirror/prosemirror-example-setup/blob/master/src/keymap.ts) the following shortcuts are implemented (Dont think we need all, just as inspiration).
|
|
I'm not a mac user, how does this map to macos and does it make sense there? |
|
I am neither, but according to documentation Mod- matches to CTRL on Win/Lin and Command on Mac. Only italic and bold is implemented in this pull request, the test is just a list from the example implementation. |
|
Is this only working with a special browser in windows 10? I tried with edge and firefox. |
|
@StefanP74 it's been a while since I applied this PR to my installation (a shame it's not been merged yet 😢). If I remember correctly this code ends up in
|
|
Hello,
what i did:
* apt install yarnpkg
* ln -s /usr/bin/yarnpkg /usr/bin/yarn
* cd ~
* wget https://github.com/gyger/dokuwiki-plugin-prosemirror/archive/refs/heads/master.zip
* unzip ./master.zip
* wget https://github.com/gyger/dokuwiki-plugin-prosemirror/archive/refs/heads/fix-shortcutsformat.zip
* unzip ./fix-shortcutsformat.zip
* wget https://github.com/gyger/dokuwiki-plugin-prosemirror/archive/refs/heads/fix-hardbreak.zip
* unzip ./fix-hardbreak.zip
* copy ./dokuwiki-plugin-prosemirror-fix-shortcutsformat/* to ./dokuwiki-plugin-prosemirror-master (replace all)
* copy ./dokuwiki-plugin-prosemirror-fix-hardbreak/* to ./dokuwiki-plugin-prosemirror-master (replace all)
* cd ./dokuwiki-plugin-prosemirror-master
* yarn
* yarn build
* copy ./dokuwiki-plugin-prosemirror-master to /var/www/html/dokuwiki/lib/plugins/prosemirror (replace all)
* replace rights of dirs and files in /var/www/html/dokuwiki/lib/plugins/prosemirror/* (www-data)
Ther are some warnings while running yarn build but no errors.
So I tried it again to do Shift+Enter in dokuwiki at visual editor… but still not working ☹
Should it work with above steps?
Did I something wrong?
Thx for your help.
|
|
@StefanP74 I can't test your approache, but if you are working directly on the system the easiest approach would be:
Afterwards make sure to refresh the dokuwiki page in your browser, ideally clearing cache, and try a different browser, to make sure you are not experiencing a cached javascript. |
|
Hallo,
yarn build …..
….
ERROR in ./script/plugins/Keymap/keymap.js
Module Error (from ./node_modules/eslint-loader/index.js):
/var/www/html/dokuwiki/lib/plugins/prosemirror/script/plugins/Keymap/keymap.js
4:32 error 'exitCode' is defined but never used no-unused-vars
✖ 1 problem (1 error, 0 warnings)
@ ./script/main.js 17:14-48
error Command failed with exit code 2.
|
|
@StefanP74 You're right, this branch does not build on it's own, it is dependend on #203. I failed to mention You need to actually apply both changes, #203 and #204:
Afterwards make sure to refresh the dokuwiki page in your browser, ideally clearing cache, and try a different browser, to make sure you are not experiencing a cached javascript. @gyger I think you need to remove |
|
Hello,
YESS!! It’s working now. 🙂
Thank you very much for your help.
Prosemirror now works perfectly with Shift+Enter.
We are very happy about this well-functioning and simple to use WYSIWYG editor... as ckgedit does not do its job particularly well due to instability and extreme problems with <code>...</code>.
Don’t know you know it, … but this is an example what happens with ckgedit:
<code>
for %%f in ("%folder%\*") do (
set filename=%%~nxf
set newname=%timestamp%_!filename!
ren "%%f" "!newname!"
)
</code>
... and this is what it becomes after saving:
<code>
for <nowiki>f in ("%folder%\*") do (
set filename=</nowiki>~nxf
set newname=%timestamp%_!filename! ren "<nowiki>f" "!newname!"
)
</code>
And there’s no way to disable that code-chaos from my side.
Prosemirror can handle this perfectly without any code transformation inside <code>-tag.
Perfect!
I will say thank you to all developers of prosemirror for that fantastic dokuwiki-plugin. 👍👍
Best regards
Stefan
|
This adds the function to use CTRL + B and CTRL + I to toggle between bold and italic.